﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MSALPost;

namespace MSAL
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private async void button1_Click(object sender, EventArgs e)
        {
            MSGraphHelper msg = new MSGraphHelper("3ac2c4df-ac5a-4175-b16a-cb2c9edbbae4", "f8cdef31-a31e-4b4a-93e4-5f571e91255a");
            try
            {
                var ret = msg.CallGraph(txtUrl.Text);
                if(ret.Result.Code==0)
                    txtContent.Text = ret.Result.Error;
                else
                    txtContent.Text = ret.Result.Data;
            }
            catch (Exception ex)
            {
                txtContent.Text ="错误信息："+ ex.Message;
            }
        }
    }
}
